<?php
/**
 * User: 苏翔
 * Date: 2024/8/11 12:52
 */

namespace App;

/**
 * 奖池配置类，用于定义奖池相关配置常量及描述
 */
class HscoinConf
{
    const STATUS_ENABLED = 1;
    const STATUS_DISABLED = -1;
    // 奖池类型的文本描述
    const FIELD_APP_NAME = 'app_name';
    const FIELD_APP_ENABLED = 'app_enabled';
    const FIELD_BASE_AMOUNT = 'app_base_amount';
    const FIELD_BASE_MONEY_AMOUNT = 'app_base_money_amount';// 原型上定义，应该没有用
    const FIELD_EXCHANGE_FEE_RATE = 'exchange_fee_rate';
    /**
     *
     */

    const CATEGORY_INCOME_SELL = 1;
    const CATEGORY_INCOME_PURCHASING = 2;
    const CATEGORY_INCOME_STOCK = 3;
    const CATEGORY_INCOME_REGISTER = 4;
    const CATEGORY_INCOME_HELP_ACCEL = 5;
    const CATEGORY_INCOME_HELP_BARGAIN = 6;
    const CATEGORY_INCOME_CONSIGN = 7;

    const CATEGORY_EXPENSE_EXCHANGE = -1;

    const STATS_TYPE_BASE_BALANCE = 10;// 基础金豆应该方式统计表里面
    const STATS_TYPE_BALANCE = 9;
    const STATS_TYPE_CATEGORY_INCOME = 1;
    const STATS_TYPE_CATEGORY_EXPENSE = -1;
    /**
     * @var string[] 奖池状态描述 ，前两个状态CRMEB默认状态，后面为log状态
     */
    static array $statusDesc = [
        self::STATUS_ENABLED => '正常/启用',
        self::STATUS_DISABLED => '取消/禁用',
    ];
    /**
     * @var string[] 奖池收入分类描述 ，可以用户□订单利润
     */
    static array $categoryIncomeLabelMap = [
        self::CATEGORY_INCOME_SELL => '销售津贴',
        self::CATEGORY_INCOME_PURCHASING => '进货津贴',
        self::CATEGORY_INCOME_STOCK => '库存津贴',
        self::CATEGORY_INCOME_REGISTER => '新人注册',
        self::CATEGORY_INCOME_HELP_ACCEL => '助力加速',
        self::CATEGORY_INCOME_HELP_BARGAIN => '助力砍价',
        self::CATEGORY_INCOME_CONSIGN => '寄售津贴',
    ];

    /**
     * @var string[] 奖池收入分类描述 ，可以用户□订单利润
     */
    static array $categoryIncomeFieldMap = [
        self::CATEGORY_INCOME_SELL => 'sell_enabled',
        self::CATEGORY_INCOME_PURCHASING => 'purchasing_enabled',
        self::CATEGORY_INCOME_STOCK => 'stock_enabled',
        self::CATEGORY_INCOME_REGISTER => 'register_enabled',
        self::CATEGORY_INCOME_HELP_ACCEL => 'help_accel_enabled',
        self::CATEGORY_INCOME_HELP_BARGAIN => 'help_bargain_enabled',
        self::CATEGORY_INCOME_CONSIGN => 'consign_enabled',

    ];

    /**
     * @var string[] 奖池支出分类描述□佣金支出
     */
    static $categoryExpenseLabelMap = [
        self::CATEGORY_EXPENSE_EXCHANGE => '兑换现金',

    ];
    /**
     * @var string[] 奖池支出分类描述□佣金支出
     */
    static $categoryExpenseFieldMap = [

    ];


    /**
     * @var string[]
     */
    static $fundCountCacheNote = [
        self::STATS_TYPE_BALANCE => '余额',
        self::STATS_TYPE_CATEGORY_INCOME => '分类收入',
        self::STATS_TYPE_CATEGORY_EXPENSE => '分类支出',
    ];
    const CACHE_KEY_BALANCE = 'hscoin_balance';
    const CACHE_LIFE_TIME_BALANCE = 60;
    const STATS_CACHE_KEY = 'hscoin_balance';
    const STATS_CACHE_LIFE_TIME = 60;
    const CHECK_HANDLED_BILL_NUM = 1000;

    const EXCHAGNE_TYPE_MONEY = 1;
    const EXCHAGNE_TYPE_POINTS = 2;
}
